#!/usr/bin/env ruby1.9
# encoding: UTF-8

require 'term/ansicolor'

require './lib/hindo.rb'

describe FileTsuitta, "load tweets from file" do

    it "load tweets from file" do
		file = mock "File"
		
		file.should_receive(:readlines).and_return(["1|tom|one", "2|dick|two", "3|harry|thrww", "4|bill|foor", "5|fred|five"])
		
        twitter = FileTsuitta.new file
		tweets = twitter.get 1
		
		tweets[0].id.should == 1
		tweets[1].id.should == 2
		tweets[2].id.should == 3
		tweets[3].id.should == 4
		tweets[4].id.should == 5

		tweets[0].user.screen_name.should == "tom"
		tweets[1].user.screen_name.should == "dick"
		tweets[2].user.screen_name.should == "harry"
		tweets[3].user.screen_name.should == "bill"
		tweets[4].user.screen_name.should == "fred"

		tweets[0].user.name.should == "tom"
		tweets[1].user.name.should == "dick"
		tweets[2].user.name.should == "harry"
		tweets[3].user.name.should == "bill"
		tweets[4].user.name.should == "fred"
		
		tweets[0].text.should == "one"
		tweets[1].text.should == "two"
		tweets[2].text.should == "thrww"
		tweets[3].text.should == "foor"
		tweets[4].text.should == "five"
    end

end